<template>
  <div>
    <el-card style="max-width: 280px" shadow="hover">
      <img src="https://free-img.400040.xyz/4/2024/06/24/66794c3bcb54b.jpg" class="img" />
      <div class="info">
        <p>爱吃罗非鱼</p>
        <p>Talk is cheap, show me the code.</p>
        <div class="list" >
          <span>
            <a class="item" href="https://blog.csdn.net/zms12345677?spm=1000.2115.3001.5343">
              <img src="../assets/qq.svg" alt="">
            </a>
          </span>
          <span>
            <a class="item" href="https://blog.csdn.net/zms12345677?spm=1000.2115.3001.5343">
              <img src="../assets/csdn.svg" alt="">
            </a>
          </span>
          <span>
            <a class="item" href="https://blog.csdn.net/zms12345677?spm=1000.2115.3001.5343">
              <img src="../assets/blibli-copy.svg" alt="">
            </a>
          </span>
          <span>
            <a class="item" href="https://blog.csdn.net/zms12345677?spm=1000.2115.3001.5343">
              <img src="../assets/icon-weixin.svg" alt="">
            </a>
          </span>
          <span>
            <a class="item" href="https://blog.csdn.net/zms12345677?spm=1000.2115.3001.5343">
              <img src="../assets/github-fill.svg" alt="">
            </a>
          </span>
        </div>
        <div class="list">
          <el-collapse v-model="activecollapse" @change="handleChange">
            <el-collapse-item v-for="item in likesdata" :key="item._id" :name="index">
              <template #title> {{item.title}}<i-ep-Ship /> </template>
              <span>{{item.text}}</span>
            </el-collapse-item>
          </el-collapse>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script setup>
import { onMounted, ref } from 'vue'
import {searchlikedata} from '../../apis/likes.js'
onMounted(()=>{
  getlikes()
})
const activecollapse = ref('')
const handleChange = () => {
  console.log('object')
}
const likesdata = ref([])
const getlikes = ()=>{
  searchlikedata().then((res)=>{
    if (res.data.isok) {
      likesdata.value = res.data.data
      console.log(likesdata.value, 'like');
    }
  })
}
</script>

<style lang="less" scoped>
.info {
  text-align: center;
  margin: 0 auto;
}
.img {
  max-width: 100%;
  object-fit: cover;
}
.list {
  display: flex;
  width: 100%;
  justify-content: space-evenly;
  margin-top: 10px;
  .item{
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: none;
    border-radius: 50%;
    &>img {
    max-width: 40px;
    height: 30px;
    object-fit: cover;

  }
  }
}
</style>
